//
//  HeadUserInfoView.m
//  League
//
//  Created by 崔璨 on 2018/1/30.
//  Copyright © 2018年 ciyuanjuzhen. All rights reserved.
//

#import "HeadUserInfoView.h"
#import "BaseViewController.h"
#define kinfoLabFontColor [UIColor colorWithRed:207/255.0 green:207/255.0 blue:207/255.0 alpha:1]
@implementation HeadUserInfoView
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.frame=frame;
        
        [self setupUI];
    }
    return self;
}
-(void)setupUI
{
    
    NSInteger space = 10;
    self.backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, self.height/3, self.height/3)];
    self.backBtn.center = CGPointMake(self.backBtn.width/2, self.height/2 + 12.5);

//    self.backBtn.backgroundColor = [UIColor redColor];
    [self.backBtn setImage:[UIImage imageNamed:@"backBtn"] forState:UIControlStateNormal];
    [self addSubview:self.backBtn];
    
    self.headImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.height/1.8, self.height/1.8)];
    self.headImage.center = CGPointMake(self.backBtn.x+self.backBtn.width+self.headImage.width/2, self.backBtn.y+self.backBtn.height/2);
//    self.headImageBtn.backgroundColor = [UIColor brownColor];
    self.headImage.layer.masksToBounds = YES;
    self.headImage.layer.cornerRadius = 8;
    self.headImage.userInteractionEnabled = YES;
    [self addSubview:self.headImage];
    
    self.nameLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0,self.width-self.backBtn.width-self.headImage.width-space*2 , self.headImage.height/2.5)];
    self.nameLab.center = CGPointMake(self.headImage.x+self.headImage.width+space+self.nameLab.width/2, self.headImage.y+self.nameLab.height/2);
//    self.nameLab.backgroundColor = [UIColor yellowColor];
    self.nameLab.font=[UIFont fontWithName:kFontName size:self.nameLab.height*0.6];
    [self addSubview:self.nameLab];
    
    
    self.infoOne = [[UILabel alloc] initWithFrame:CGRectMake(self.nameLab.x, self.nameLab.y+self.nameLab.height, self.width-self.backBtn.width-self.headImage.width-space*2, self.headImage.height/3)];
//    self.infoOne.backgroundColor = [UIColor redColor];
    self.infoOne.font=[UIFont fontWithName:kFontName size:self.infoOne.height*0.5];
    self.infoOne.textColor = kinfoLabFontColor;
    [self addSubview:self.infoOne];
    
    
    self.infoTwo = [[UILabel alloc] initWithFrame:CGRectMake(self.infoOne.x, self.infoOne.y+self.infoOne.height, self.infoOne.width, self.infoOne.height)];
//    self.infoTwo.backgroundColor = [UIColor blueColor];
    self.infoTwo.font=[UIFont fontWithName:kFontName size:self.infoTwo.height*0.5];
    self.infoTwo.textColor = kinfoLabFontColor;
    [self addSubview:self.infoTwo];
    
    //more
    UIButton *moreBtn = [[UIButton alloc] init];
    moreBtn.frame = self.backBtn.frame;
    moreBtn.center = CGPointMake(self.width - self.backBtn.center.x, self.backBtn.center.y);
    [moreBtn setImage:[UIImage imageNamed:@"icon_more"] forState:UIControlStateNormal];
    moreBtn.hidden = YES;
    [self addSubview:moreBtn];
    self.moreBtn = moreBtn;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
